﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HotelList.aspx.cs" Inherits="HQWeb.Resources.HotelList.HotelList" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
        <link href="../../Styles/GridViewStyle.css" rel="Stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
     <asp:ScriptManager ID="ScriptManager" runat="server" />
    <ajaxToolkit:AutoCompleteExtender ID="ajaxtitel" runat="server" TargetControlID="txtName" ServicePath="../../Wbserver/GetSmartTips.asmx" 
    ServiceMethod="GetHotelName" MinimumPrefixLength="1" ></ajaxToolkit:AutoCompleteExtender> 
    <div>
        <table width="98%">
            <tr>
                <td colspan="4">
                    &nbsp;酒店名称： &nbsp;<asp:TextBox ID="txtName" runat="server"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;地 区：<asp:DropDownList runat="server" Width="158px" ID="drop_Area">
                        <asp:ListItem Text="全部" Value="-1" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="本地区" Value="0"></asp:ListItem>
                        <asp:ListItem Text="其他地区" Value="1"></asp:ListItem>
                    </asp:DropDownList>&nbsp;&nbsp;&nbsp;&nbsp; <asp:Button ID="bnSearch" runat="server" Text="查 询" OnClick="tbnSearch_Click" />
                </td>
                </tr>
            <tr>
                <td colspan="4">
                    <br />
                    <asp:GridView ID="GridView1" CssClass="GridViewStyle" runat="server" AutoGenerateColumns="False" PageSize="10"
                        Width="100%" AllowPaging="True" CellPadding="4" EmptyDataText="没有数据记录！！" OnPageIndexChanging="GridView1_PageIndexChanging" 
                        GridLines="None" DataKeyNames="HOTEL_ID" OnRowEditing="GridView1_RowEditing">
                        <Columns>
                            <asp:TemplateField HeaderText="序号" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <%#Container.DisplayIndex +1%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="HOTEL_NAME" HeaderText="酒店名称" ItemStyle-Width="35%" ItemStyle-HorizontalAlign="Center">
                                <ItemStyle Width="30%"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField DataField="HOTEL_LOCATION" HeaderText="酒店地址" ItemStyle-Width="" ItemStyle-HorizontalAlign="Center">
                                <ItemStyle Width="35%" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="操作" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnEdit" runat="server" Text="选 择" CommandName="Edit" CommandArgument='<%#Eval("HOTEL_ID")%>'></asp:LinkButton>
                                    <%--<asp:LinkButton ID="btnDelete" runat="server" Text="删 除" CommandName="DeleteData" CommandArgument='<%#Eval("LIBRARY_ID")%>' OnClientClick=" return confirm('确定删除？')"></asp:LinkButton>--%>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerTemplate>
                            <table width="100%">
                                <tr>
                                    <td style="text-align: center">
                                        第<asp:Label ID="lblPageIndex" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1  %>' />页
                                        共<asp:Label ID="lblPageCount" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount  %>' />页
                                        <asp:LinkButton ID="btnFirst" runat="server" CausesValidation="False" CommandArgument="First"
                                            CommandName="Page" Text="首页" />
                                        <asp:LinkButton ID="btnPrev" runat="server" CausesValidation="False" CommandArgument="Prev"
                                            CommandName="Page" Text="上一页" />
                                        <asp:LinkButton ID="btnNext" runat="server" CausesValidation="False" CommandArgument="Next"
                                            CommandName="Page" Text="下一页" />
                                        <asp:LinkButton ID="btnLast" runat="server" CausesValidation="False" CommandArgument="Last"
                                            CommandName="Page" Text="尾页" />
                                        <asp:TextBox ID="txtNewPageIndex" runat="server" Width="28px" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1  %>' />
                                        <asp:LinkButton ID="btnGo" runat="server" CausesValidation="False" CommandArgument="-1"
                                            CommandName="Page" Text="GO" /><!-- here set the CommandArgument of the Go Button to '-1' as the flag -->
                                    </td>
                                </tr>
                            </table>
                        </PagerTemplate>
                        <FooterStyle CssClass="GridViewFooterStyle" />
                        <RowStyle CssClass="GridViewRowStyle" />
                        <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                        <PagerStyle CssClass="GridViewPagerStyle" />
                        <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                        <HeaderStyle CssClass="GridViewHeaderStyle" />
                    </asp:GridView>
                    <br />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
